mod t_product;

fn main() {
    // println!("Hello, world!");
    // let r = t_product::t1(3);
    // println!("{:?}", r);
    // let m: Vec<u128> = (1..=0 as u128).into_iter().collect();
    // println!("len: {}", m.len());
    // for i in (1..=0 as u128) {
    //     println!("for: {}", i);
    // }

    // -- 3
    // let mut numbers = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
    // let a = t_product::median(&mut numbers);
    // println!("[1] {:?}", a);

    // numbers = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
    // let a = t_product::median(&mut numbers);
    // println!("[2] {:?}", a);

    // -- 4
    // let mut input: Vec<i32> = Vec::new();
    // input.push(25);
    // input.push(25);
    // input.push(21);
    // input.push(21);
    // input.push(21);
    // input.push(23);
    // let a = t_product::mode(&input);
    // println!("{:?}", a);

    // let c = [1, 2, 3];
    // assert_eq!(c.iter().max(), Some(&3));
    // println!("{:?}", c.iter().max());

    // -- 5
    let number = 3_usize;
    // 使用 format! 宏将数字格式化为二进制字符串
    let binary_string = format!("{:b}", number);
    println!(
        "The binary representation of {:?} is {:?}",
        number, binary_string
    );

    let plus = 29_usize;
    let r = plus & number;
    //let r = plus | number;
    //let r = plus ^ number;
    let binary_string = format!("{:b}", r);
    println!(
        "The binary representation of {:?} is {:?}",
        r, binary_string
    );
}
